const message = {

	success(params) {
		if (typeof params !== 'object') params = {
			content: params + ''
		};
		uni.showToast({
			title: params.content || '',
			icon: 'success',
			duration: params.duration || 1500,
			success: params.resolve
		})
		return true
	},

	error(params) {
		if (typeof params !== 'object') params = {
			content: params + ''
		};
		uni.showToast({
			title: params.content,
			icon: 'error',
			duration: params.duration || 1500,
			success: params.resolve
		})
		return true
	},

	info(params) {
		// #ifndef APP-PLUS
		if (typeof params !== 'object') params = {
			content: params + ''
		};
		uni.showToast({
			title: params.content || '',
			icon: 'none',
			// position: 'bottom',
			duration: params.duration || 1500,
			success: params.resolve
		})
		// #endif
		
		// #ifdef APP-PLUS
		if (typeof params !== 'object') params = {
			content: params + ''
		};
		plus.nativeUI.toast(
			"<font style=\'font-size:18px\'>" + `${params.content}` + "</font>", {
				type: 'richtext',
				duration: 'short',
				verticalAlign: 'middle',
				richTextStyle: {
					align: 'center'
				}
			}
		);
		// #endif

		return true
	},

	tips(params) {
		if (typeof params !== 'object') params = {
			content: params + ''
		};
		uni.showToast({
			title: params.content || '',
			icon: 'none',
			// position: 'bottom',
			duration: params.duration || 1500,
			success: params.resolve
		})
		return true
	}
}

export {
	message
};